﻿using AbstractFactory.Factory;
using IBusinessLogicLayer.IBaseInterface;
using IDataAccessLayer.IBaseInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BusinessLogicLayer.BaseInterface
{
    public abstract class BusinessLogic<D, T> : IBusinessLogic<D, T>
        where D : IBaseDataAccessLayer<T>
        where T : class
    {
        public abstract string DataAccessfullName { get; }

        protected readonly D dal;
        public BusinessLogic()
        {
            dal = AbstractFactory<D>.CreateDataAccess(DataAccessfullName);
        }
        //登录，显示，反填
        public List<T> Getlist<T>(params System.Data.SqlClient.SqlParameter[] param)
        {
            return dal.Getlist<T>(param);
        }

        //添加
        public bool ToAddSQL(T t)
        {
            return dal.ToAddSQL(t);
        }
    }
}
